package edu.spec.pms.web;


import java.util.HashMap;
import java.util.Map;

public class CommandContext {

	/**
	 * 存储每个在线用户的userCommand
	 * key为sessionId,value为该用户所拥有的所有的command组成的String
	 */
	private static Map<String, String> userCommandMap = new HashMap<String, String>();

	private CommandContext() {
	}

	public static void addUserCommand(String sid, String userCommand){
		userCommandMap.put(sid, userCommand);
	}

	public static void removeUserCommand(String sid){
		userCommandMap.remove(sid);
	}

	public static String getUserCommand(String sid) {
		return userCommandMap.get(sid);
	}
}
